function h=silverman_rule(x,type)

[dim1, ~] = size(x);
switch lower(type)
   case {'biweight','quartic','bi','quart'}
        sigma_hat=std(x);
        n=dim1;
        nu=2;
        C_nu=2.78;
        h=sigma_hat * C_nu * n^(-1/(2*nu+1));
   otherwise
      error('Kernel type not recognized');
end

    %
